package com.gome.ocean.dao.model.dsm;

import com.gome.ocean.common.enums.DataBaseType;
import com.gome.ocean.common.enums.DataSource;

/**
 * 共用数据源
 * 
 * @author haqiaolong 2016年8月11日 下午6:21:33
 * @since 5.0.0
 */
public class CommonDataBase {

    private Long dataBaseId;

    private Long dataSourceId;

    private String dbName; // 名称

    private String sourceDescribe; // 描述

    private DataBaseType dataBaseType; // 数据源类型

    private DataSource dataSource; // 来源

    private String gname;// 组名称

    public String getGname() {
        return gname;
    }

    public void setGname(String gname) {
        this.gname = gname;
    }

    public String getDbName() {
        return dbName;
    }

    public void setDbName(String dbName) {
        this.dbName = dbName;
    }

    public String getSourceDescribe() {
        return sourceDescribe;
    }

    public void setSourceDescribe(String sourceDescribe) {
        this.sourceDescribe = sourceDescribe;
    }

    public DataBaseType getDataBaseType() {
        return dataBaseType;
    }

    public void setDataBaseType(DataBaseType dataBaseType) {
        this.dataBaseType = dataBaseType;
    }

    public DataSource getDataSource() {
        return dataSource;
    }

    public void setDataSource(DataSource dataSource) {
        this.dataSource = dataSource;
    }

    public Long getDataBaseId() {
        return dataBaseId;
    }

    public void setDataBaseId(Long dataBaseId) {
        this.dataBaseId = dataBaseId;
    }

    public Long getDataSourceId() {
        return dataSourceId;
    }

    public void setDataSourceId(Long dataSourceId) {
        this.dataSourceId = dataSourceId;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((dataBaseId == null) ? 0 : dataBaseId.hashCode());
        result = prime * result + ((dataBaseType == null) ? 0 : dataBaseType.hashCode());
        result = prime * result + ((dataSource == null) ? 0 : dataSource.hashCode());
        result = prime * result + ((dbName == null) ? 0 : dbName.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) return true;
        if (obj == null) return false;
        if (getClass() != obj.getClass()) return false;
        CommonDataBase other = (CommonDataBase) obj;
        if (dataBaseId == null) {
            if (other.dataBaseId != null) return false;
        } else if (!dataBaseId.equals(other.dataBaseId)) return false;
        if (dataBaseType != other.dataBaseType) return false;
        if (dataSource != other.dataSource) return false;
        if (dbName == null) {
            if (other.dbName != null) return false;
        } else if (!dbName.equals(other.dbName)) return false;
        return true;
    }

    @Override
    public String toString() {
        return "CommonDataBase [dataBaseId=" + dataBaseId + ", dataSourceId=" + dataSourceId + ", dbName=" + dbName
               + ", sourceDescribe=" + sourceDescribe + ", dataBaseType=" + dataBaseType + ", dataSource=" + dataSource
               + "]";
    }
}
